load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "logstore",
    srcs = [
        "bytes_tracker.go",
        "logstore.go",
        "sideload.go",
        "sideload_disk.go",
        "stateloader.go",
        "sync_waiter.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/logstore",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/kv/kvserver/raftentry",
        "//pkg/kv/kvserver/raftlog",
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/util/buildutil",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//record",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_redact//:redact",
        "@org_golang_x_time//rate",
    ],
)

go_test(
    name = "logstore_test",
    srcs = [
        "bytes_tracker_test.go",
        "logstore_bench_test.go",
        "sideload_test.go",
        "sync_waiter_test.go",
    ],
    embed = [":logstore"],
    deps = [
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/kv/kvserver/raftentry",
        "//pkg/kv/kvserver/raftlog",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/util/humanizeutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_time//rate",
    ],
)
